package com.youngjun.user.pojo.dto;

import com.youngjun.common.pojo.dto.support.BaseDTO;

public class InterfaceDTO extends BaseDTO<InterfaceDTO> {

    private Long id;

    //接口名称
    private String name;

    //接口路径
    private String path;

    //接口路径
    private Method method;

    //接口类型
    private Type type;

    public Long getId() {
        return id;
    }

    public InterfaceDTO setId(Long id) {
        this.id = id;
        return this;
    }

    public String getName() {
        return name;
    }

    public InterfaceDTO setName(String name) {
        this.name = name;
        return this;
    }

    public String getPath() {
        return path;
    }

    public InterfaceDTO setPath(String path) {
        this.path = path;
        return this;
    }

    public Method getMethod() {
        return method;
    }

    public InterfaceDTO setMethod(Method method) {
        this.method = method;
        return this;
    }

    public Type getType() {
        return type;
    }

    public InterfaceDTO setType(Type type) {
        this.type = type;
        return this;
    }

    public enum Method {

        /**
         * GET请求
         */
        GET,

        /**
         * POST请求
         */
        POST,

        /**
         * PUT请求
         */
        PUT,

        /**
         * DELETE请求
         */
        DELETE;
    }

    public enum Type {

        /**
         * 公开接口,所有人可以访问
         */
        PUBLIC,

        /**
         * 私有接口,授权后才能访问
         */
        PRIVATE,

        /**
         * 认证后才能访问的接口
         */
        AUTHENTICATED,

        /**
         * 特定API接口,授权后才能访问
         */
        API;

    }

}